﻿using System;
using System.Text;
using System.IO;

namespace AppUtils
{
    public static class Logger
    {
        public static string AppName = null;

        public static void log(string msg)
        {
            try
            {
                TextWriter tw = File.AppendText(Utils.getPath(AppName) + @"\pptest.log");
                tw.WriteLine("{0}: {1}", DateTime.Now.ToString("yyyyMMdd-hh:mm:ss.fff"), msg);
                tw.Close();
            }
            catch (Exception e)
            {
                Console.Error.WriteLine("Error logging: {0}", e.Message);
            }
        }
    }
}
